package br.ufpe.cin.rdfilter.main;

import java.util.List;

import br.ufpe.cin.rdfilter.model.Manager;
import br.ufpe.cin.rdfilter.model.Query;
import br.ufpe.cin.rdfilter.relevance.Relevance;

public class Test {

	private static String[] ENDPOINTS = {
		"http://localhost:2020/sparql/ACM", 
        "http://localhost:2020/sparql/Budapest", 
        "http://localhost:2020/sparql/CiteSeer", 
        "http://localhost:2020/sparql/Courseware", 
        "http://localhost:2020/sparql/Curriculum", 
        "http://localhost:2020/sparql/Darmstadt", 
        "http://localhost:2020/sparql/DeepBlue", 
        "http://localhost:2020/sparql/DEPLOY", 
        "http://localhost:2020/sparql/dotAC", 
        "http://localhost:2020/sparql/ERA", 
        "http://localhost:2020/sparql/Eurecom", 
        "http://localhost:2020/sparql/FT", 
        "http://localhost:2020/sparql/IBM", 
        "http://localhost:2020/sparql/IEEE", 
        "http://localhost:2020/sparql/IRIT", 
        "http://localhost:2020/sparql/JISC", 
        "http://localhost:2020/sparql/KIST", 
        "http://localhost:2020/sparql/LAAS", 
        "http://localhost:2020/sparql/Newcastle", 
        "http://localhost:2020/sparql/NSF",  
        "http://localhost:2020/sparql/OS", 
        "http://localhost:2020/sparql/Pisa", 
        "http://localhost:2020/sparql/RAE2001", 
        "http://localhost:2020/sparql/RESEX", 
        "http://localhost:2020/sparql/RISKS", 
        "http://localhost:2020/sparql/Roma", 
        "http://localhost:2020/sparql/Southampton", 
        "http://localhost:2020/sparql/Ulm", 
        "http://localhost:2020/sparql/UNLOCODE", 
        "http://localhost:2020/sparql/Wiki"
	};
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Manager m = new Manager();
		List<Query> q;
		Relevance rel;
		String[] temp;
		long tempoInicial;
		long tempoFinal;
		/*
		System.out.println("========== Experiment 1 ==========");
		q = m.getSomeQueries();
		temp = new String[13];
		for (int i=0;i<5;i++){
			temp[i]=q.get(i).getStatement();
		}
		tempoInicial = System.currentTimeMillis();  
		for (int i = 0; i < ENDPOINTS.length; i++) {
			for(int j=0;j<5;j++){
				rel = new Relevance(ENDPOINTS[i], q.get(j).getStatement(), q.get(j).getLabel(), "notes.txt");
			}
		}
		tempoFinal = System.currentTimeMillis();  
		System.out.println("Tempo de execução: " + (tempoFinal - tempoInicial) );
		*/
		System.out.println("========== Experiment 2 ==========");
		q = m.getSomeQueries();
		temp = new String[13];
		for (int i=0;i<5;i++){
			temp[i]=q.get(i).getStatement();
		}
		tempoInicial = System.currentTimeMillis();  
		for (int i = 0; i < ENDPOINTS.length; i++) {
			for(int j=0;j<5;j++){
				rel = new Relevance(ENDPOINTS[i], q.get(j).getStatement(), q.get(j).getLabel(), "notes2.txt");
			}
		}
		tempoFinal = System.currentTimeMillis();  
		System.out.println("Tempo de execução: " + (tempoFinal - tempoInicial) );
		
		System.out.println("========== Experiment 3 ==========");
		q = m.getSomeQueries();
		temp = new String[13];
		for (int i=0;i<5;i++){
			temp[i]=q.get(i).getStatement();
		}
		tempoInicial = System.currentTimeMillis();  
		for (int i = 0; i < ENDPOINTS.length; i++) {
			for(int j=0;j<5;j++){
				rel = new Relevance(ENDPOINTS[i], q.get(j).getStatement(), q.get(j).getLabel(), "notes3.txt");
			}
		}
		tempoFinal = System.currentTimeMillis();  
		System.out.println("Tempo de execução: " + (tempoFinal - tempoInicial) );
		
		/*
		System.out.println("========== Experiment 4 ==========");
		q = m.getQueries();
		temp = new String[13];
		for (int i=0;i<q.size();i++){
			temp[i]=q.get(i).getStatement();
		}
		tempoInicial = System.currentTimeMillis();  
		for (int i = 0; i < ENDPOINTS.length; i++) {
			for(int j=0;j<q.size();j++){
				rel = new Relevance(ENDPOINTS[i], q.get(j).getStatement(), q.get(j).getLabel(), "notes.txt");
			}
		}
		tempoFinal = System.currentTimeMillis();  
		System.out.println("Tempo de execução: " + (tempoFinal - tempoInicial) );
		
		System.out.println("========== Experiment 5 ==========");
		q = m.getQueries();
		temp = new String[13];
		for (int i=0;i<q.size();i++){
			temp[i]=q.get(i).getStatement();
		}
		tempoInicial = System.currentTimeMillis();  
		for (int i = 0; i < ENDPOINTS.length; i++) {
			for(int j=0;j<q.size();j++){
				rel = new Relevance(ENDPOINTS[i], q.get(j).getStatement(), q.get(j).getLabel(), "notes2.txt");
			}
		}
		tempoFinal = System.currentTimeMillis();  
		System.out.println("Tempo de execução: " + (tempoFinal - tempoInicial) );
		
		System.out.println("========== Experiment 6 ==========");
		q = m.getQueries();
		temp = new String[13];
		for (int i=0;i<q.size();i++){
			temp[i]=q.get(i).getStatement();
		}
		tempoInicial = System.currentTimeMillis();  
		for (int i = 0; i < ENDPOINTS.length; i++) {
			for(int j=0;j<q.size();j++){
				rel = new Relevance(ENDPOINTS[i], q.get(j).getStatement(), q.get(j).getLabel(), "notes3.txt");
			}
		}
		tempoFinal = System.currentTimeMillis();  
		System.out.println("Tempo de execução: " + (tempoFinal - tempoInicial) );
		*/
		System.out.println("========== Experiment 7 ==========");
		q = m.getSomeQueries();
		temp = new String[13];
		for (int i=0;i<5;i++){
			temp[i]=q.get(i).getStatement();
		}
		tempoInicial = System.currentTimeMillis();  
		for (int i = 0; i < ENDPOINTS.length; i++) {
			for(int j=0;j<5;j++){
				rel = new Relevance(ENDPOINTS[i], q.get(j).getStatement(), q.get(j).getLabel(), "notes4.txt");
			}
		}
		tempoFinal = System.currentTimeMillis();  
		System.out.println("Tempo de execução: " + (tempoFinal - tempoInicial) );
		/*
		System.out.println("========== Experiment 8 ==========");
		q = m.getSomeQueries();
		temp = new String[13];
		for (int i=0;i<5;i++){
			temp[i]=q.get(i).getStatement();
		}
		tempoInicial = System.currentTimeMillis();  
		for (int i = 0; i < ENDPOINTS.length; i++) {
			for(int j=0;j<5;j++){
				rel = new Relevance(ENDPOINTS[i], q.get(j).getStatement(), q.get(j).getLabel(), "notes5.txt");
			}
		}
		tempoFinal = System.currentTimeMillis();  
		System.out.println("Tempo de execução: " + (tempoFinal - tempoInicial) );
		
		System.out.println("========== Experiment 9 ==========");
		q = m.getSomeQueries();
		temp = new String[13];
		for (int i=0;i<5;i++){
			temp[i]=q.get(i).getStatement();
		}
		tempoInicial = System.currentTimeMillis();  
		for (int i = 0; i < ENDPOINTS.length; i++) {
			for(int j=0;j<5;j++){
				rel = new Relevance(ENDPOINTS[i], q.get(j).getStatement(), q.get(j).getLabel(), "notes6.txt");
			}
		}
		tempoFinal = System.currentTimeMillis();  
		System.out.println("Tempo de execução: " + (tempoFinal - tempoInicial) );
		
		
		System.out.println("========== Experiment 10 ==========");
		q = m.getQueries();
		temp = new String[13];
		for (int i=0;i<q.size();i++){
			temp[i]=q.get(i).getStatement();
		}
		tempoInicial = System.currentTimeMillis();  
		for (int i = 0; i < ENDPOINTS.length; i++) {
			for(int j=0;j<q.size();j++){
				rel = new Relevance(ENDPOINTS[i], q.get(j).getStatement(), q.get(j).getLabel(), "notes4.txt");
			}
		}
		tempoFinal = System.currentTimeMillis();  
		System.out.println("Tempo de execução: " + (tempoFinal - tempoInicial) );
		
		System.out.println("========== Experiment 11 ==========");
		q = m.getQueries();
		temp = new String[13];
		for (int i=0;i<q.size();i++){
			temp[i]=q.get(i).getStatement();
		}
		tempoInicial = System.currentTimeMillis();  
		for (int i = 0; i < ENDPOINTS.length; i++) {
			for(int j=0;j<q.size();j++){
				rel = new Relevance(ENDPOINTS[i], q.get(j).getStatement(), q.get(j).getLabel(), "notes5.txt");
			}
		}
		tempoFinal = System.currentTimeMillis();  
		System.out.println("Tempo de execução: " + (tempoFinal - tempoInicial) );
		
		System.out.println("========== Experiment 12 ==========");
		q = m.getQueries();
		temp = new String[13];
		for (int i=0;i<q.size();i++){
			temp[i]=q.get(i).getStatement();
		}
		tempoInicial = System.currentTimeMillis();  
		for (int i = 0; i < ENDPOINTS.length; i++) {
			for(int j=0;j<q.size();j++){
				rel = new Relevance(ENDPOINTS[i], q.get(j).getStatement(), q.get(j).getLabel(), "notes6.txt");
			}
		}
		tempoFinal = System.currentTimeMillis();  
		System.out.println("Tempo de execução: " + (tempoFinal - tempoInicial) );
		
		*/
	}
}